package com.situ.day11;

import java.awt.Button;
import java.awt.GridLayout;
import java.nio.Buffer;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class LoginDemo {
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		JPanel panel1 = new JPanel();
		frame.add(panel1);
		panel1.setLayout(new GridLayout(3, 1));
		//用户
		JPanel nameJPanel = new JPanel();
		JLabel nameJLabel = new JLabel("用户名：");
		JTextField nameField = new JTextField(10);
		nameJPanel.add(nameJLabel);
		nameJPanel.add(nameField);
		panel1.add(nameJPanel);
		//密码
		JPanel passWordJPanel = new JPanel();
		JLabel passWordJLabel = new JLabel("密码：");
		JTextField passWordField = new JTextField(10);
		passWordJPanel.add(passWordJLabel);
		passWordJPanel.add(passWordField);
		panel1.add(passWordJPanel);
		//登录
		JPanel loginJPanel = new JPanel(); 
		JButton loginButton = new JButton("登录");
		JButton cancelButton = new JButton("退出");
		loginJPanel.add(loginButton);
		loginJPanel.add(cancelButton);
		panel1.add(loginJPanel);
		
		frame.setVisible(true);
		frame.setBounds(500, 500, 500, 600);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
}
